<?php echo '<?xml version="1.0" encoding="UTF-8" ?>'."\n"; ?>
<rss version="2.0">
    <channel>
        <title><![CDATA[<?php echo xml_convert(htmlentities($BBX['bricabox']->name, ENT_COMPAT, 'UTF-8')); ?>]]></title>
        <link><?php echo str_replace('://', "://{$BBX['bricabox']->subdomain}.", APP_ROOT_URL); ?></link>
        <description><![CDATA[<?php echo xml_convert(htmlentities($BBX['bricabox']->description, ENT_COMPAT, 'UTF-8')); ?>]]></description>
        <language>en-us</language>
        <pubDate><?php echo mysql_now(); ?></pubDate>
        <lastBuildDate><?php echo mysql_now(); ?></lastBuildDate>
        <generator>http://www.bricabox.com/version/1.0/</generator>
        <webMaster>support@bricabox.com</webMaster>
<?php
if ($content):
	foreach ($content->result() as $entry):
		$type = $this->Content_model->get_content_type($entry->content_type_id);
?>  
        <item>
            <title><![CDATA[<?php echo xml_convert($entry->field1_value); ?>]]></title>
            <link><?php echo str_replace('://', "://{$BBX['bricabox']->subdomain}.", APP_ROOT_URL); ?><?php echo content_url($entry); ?></link>
            <description><![CDATA[<?php echo xml_convert($entry->search_field2); ?>]]></description>
            <pubDate><?php echo xml_convert($entry->created_at); ?></pubDate>
        </item>
<?php  
    endforeach;
endif; 
?>
    </channel>
</rss>

